package com.itheima.mp.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.mp.domain.dto.PageDTO;
import com.itheima.mp.domain.po.Result;
import com.itheima.mp.domain.po.User;
import com.itheima.mp.domain.query.UserQuery;
import com.itheima.mp.domain.vo.UserVO;

import java.util.List;

public interface IUserService extends IService<User> {
    /**
     * 根据id扣减余额
     * @param id
     * @param money
     * @return
     */
    void deductionMoneyById(Long id, Integer money);

    /**
     * 复杂条件查询
     *
     * @param name
     * @param status
     * @param minBalance
     * @param maxBalance
     * @return
     */
    List<User> queryUsers(String name, Integer status, Integer minBalance, Integer maxBalance);

    /**
     * 根据id查询用户信息
     * @param id
     * @return
     */
    UserVO queryUserAndAddressById(Long id);

    /**
     * 根据ids批量查询用户
     * @param ids
     * @return
     */
    List<UserVO> queryUserAndAddressByIds(List<Long> ids);

    /**
     * 分页查询
     *
     * @param userQuery
     * @return
     */
    Result<PageDTO<UserVO>> queryUsersPage(UserQuery userQuery);
}
